#include <stdio.h>
#include <string.h>

#define ERR_NAME_TOO_LONG 1

#define NAME_LENGTH 20

int main(int argc, char **argv)
{
  char name[NAME_LENGTH];
  if(strlen(argv[1])<NAME_LENGTH)
  {
    strcpy(name, argv[1]);
  }
  else
  {
    /* it's better to write on the standard error...
     * try to run the program redirecting standard output to a file
     * to see the difference...
     * 
     * ./primo AVeryLongNameLongerThan20Characters > /dev/null
     * 
     */
    
    fprintf(stderr, "Name too long!\n");
    return ERR_NAME_TOO_LONG; 
  }
  
  printf("Hello, %s!\n", name);
  return 0;
}
